package com.example.test;

import android.animation.ValueAnimator;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;

import com.beardedhen.androidbootstrap.BootstrapProgressBar;
import com.beardedhen.androidbootstrap.TypefaceProvider;

import butterknife.BindView;
import butterknife.ButterKnife;

public final class MainActivity extends AppCompatActivity {
    @BindView(R.id.pro)
    BootstrapProgressBar pro;
    @BindView(R.id.refresh)
    ConstraintLayout refresh;

    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TypefaceProvider.registerDefaultIconSets();
        setContentView(R.layout.activity_main);

        ButterKnife.bind(this);

        ValueAnimator valueAnimator = ValueAnimator.ofInt(0, 100);
        valueAnimator.addUpdateListener(animation -> pro.setProgress(((int) animation.getAnimatedValue())));
        valueAnimator.setDuration(1000);
        valueAnimator.setRepeatCount(ValueAnimator.INFINITE);
        valueAnimator.start();

//        RotateAnimation rotateAnimation = new RotateAnimation(0, 360);
//        pro.setAnimation(rotateAnimation);
//        rotateAnimation.setDuration(100);
//        rotateAnimation.setRepeatCount(Animation.INFINITE);
//        rotateAnimation.start();
    }
}
